#include "Debug.hpp"
#include "OpenGL.hpp"

namespace cge {
	void debugCube( double w ) {
		double s = w/2.0;
		glBegin(GL_QUADS);
		
		// top
		glNormal3d(0.0,1.0,0.0);
		glVertex3d(-s, s, s);
		glVertex3d( s, s, s);
		glVertex3d( s, s,-s);
		glVertex3d(-s, s,-s);

		// bottom
		glNormal3d(0.0,-1.0,0.0);
		glVertex3d(-s,-s,-s);
		glVertex3d( s,-s,-s);
		glVertex3d( s,-s, s);
		glVertex3d(-s,-s, s);

		// left
		glNormal3d(-1.0,0.0,0.0);
		glVertex3d(-s,-s, s);
		glVertex3d(-s, s, s);
		glVertex3d(-s, s,-s);
		glVertex3d(-s,-s,-s);

		// right
		glNormal3d(1.0,0.0,0.0);
		glVertex3d( s,-s,-s);
		glVertex3d( s, s,-s);
		glVertex3d( s, s, s);
		glVertex3d( s,-s, s);
		
		// front
		glNormal3d(0.0,0.0,-1.0);
		glVertex3d(-s, s,-s);
		glVertex3d( s, s,-s);
		glVertex3d( s,-s,-s);
		glVertex3d(-s,-s,-s);

		// back
		glNormal3d(0.0,0.0,1.0);
		glVertex3d(-s,-s,s);
		glVertex3d( s,-s,s);
		glVertex3d( s, s,s);
		glVertex3d(-s, s,s);
		
		glEnd();
	}

	void debugBillboard( double w ) {
		double s = w/2;
		glColor4d(0.01,0.006,0.0,0.5);
		
		glPointSize(20.0);
		glBegin(GL_POINTS);
		// front
		glVertex3d( 0,0,0);
		glEnd();
	}
}